import React,{Component} from 'react'
import {
    Platform,
    StyleSheet,
    Text,
    Image,
    View,
    TextInput,
    Alert,
    Slider,
    ScrollView,
    TouchableOpacity,
    ProgressBarAndroid,
} from 'react-native';
import FindItem from '../ui/findItem';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import TabLoadding from '../ui/tabLadding'
import pxToDp from '../config/pxToDp';
export default class SettingScene extends Component {
    //退出
    exitApp() {
        storage.remove({
            key: 'loginState'
        });
        this.props.navigation.replace('loginState')
        console.log(123)

    }
    render(){
        return(
            <View style={styles.partend}>
                <TouchableOpacity
                //chatting
                    onPress={() => {
                        this.props.navigation.navigate('chatting')
                    }}
                >
                    <View >
                        <FindItem icon={'comment-text-outline'} iconBg={{ backgroundColor: 'rgb(255,150,1)', }} text='聊天设置' />
                    </View>
                </TouchableOpacity>
                <TouchableOpacity
                //NotroubleScene
                    onPress = {
                        () => {
                            this.props.navigation.navigate('notrouble')
                        }
                    }
                >
                    <View >
                        <FindItem icon={'alarm-light'} iconBg={{ backgroundColor: 'rgb(0,170,245)', }} text='消息通知' />
                    </View>
                </TouchableOpacity>
                <TouchableOpacity
                //Privacy
                    onPress = {
                        () => {
                            this.props.navigation.navigate('privacy')
                        }
                    }
                >
                    <View style={styles.danditem}>
                        <FindItem icon={'account-key'} borderBottom={{borderBottomWidth: 0,}} iconBg={{ backgroundColor: 'rgb(154,210,34)', }} text='隐私安全' />
                    </View>
                </TouchableOpacity>
                <TouchableOpacity 
                        onPress={() => {
                            this.props.navigation.navigate('about')
                        }} >
                    <View >
                        <FindItem icon={'information-variant'} iconBg={{ backgroundColor: 'rgb(171,136,255)', }} text='关于随聊' />
                    </View>
                </TouchableOpacity>
                <TouchableOpacity>
                    <View >
                        <FindItem  icon={'lead-pencil'} iconBg={{ backgroundColor: 'rgb(0,170,245)', }} text='意见反馈' />
                    </View>
                </TouchableOpacity>
                <TouchableOpacity>
                    <View style={styles.danditem}>
                        <FindItem icon={'help'} borderBottom={{borderBottomWidth: 0,}} iconBg={{ backgroundColor: 'rgb(154,210,34)', }} text='用户帮助' />
                    </View>
                </TouchableOpacity>
                <TouchableOpacity 
                    onPress={this.exitApp.bind(this)}
                >
                    <View style={styles.danditem}>
                        <FindItem icon={'exit-to-app'} borderBottom={{borderBottomWidth: 0,}} iconBg={{ backgroundColor: '#ff0000', }} text='退出' />
                    </View>
                </TouchableOpacity>
            </View>
        )   
    }
}

const styles = {
    
    partend: {
        // flex:1,
        marginTop: 15,
        flex: 1,            
        // backgroundColor: "#fff",
        // flexDirection: 'row',
    },
    danditem: {
        marginBottom: 15,
    },
}